Skip to content

Raising TypeError on invalid window when using .rolling #12669 #12718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Raising TypeError on invalid window when using .rolling #12669 #12718

wants to merge 2 commits into from

Conversation

pt247
Copy link

@pt247 pt247 commented Mar 26, 2016

@@ -1354,6 +1354,8 @@ def _get_center_of_mass(com, span, halflife, alpha):


def _offset(window, center):
if com.is_float(window):
raise TypeError("Window should be of type Integer, given Float")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use if not com.is_integer(window): raise TypeError but that will clearly need to happen at a another point in the code, because at this point we accept arrays (see line below)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to happen in the _Rolling constructor. if window is not None then it can be tested for being an integer (or raise TypeError)

@jreback
Copy link
Contributor

jreback commented Apr 1, 2016

competing PR is #12714

@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Error Reporting Incorrect or improved errors from pandas labels Apr 1, 2016
@jreback
Copy link
Contributor

jreback commented Apr 10, 2016

can you rebase/update according to comments

@jreback
Copy link
Contributor

jreback commented Apr 20, 2016

can you rebase / update

@jreback
Copy link
Contributor

jreback commented Apr 26, 2016

superseded by #13002

@jreback jreback closed this Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR: better error message on invalid window when using .rolling
3 participants